package com.sky.controller.admin;

import com.sky.result.Result;
import com.sky.service.admin.UnloadService;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;


@RestController
@RequestMapping("admin/common/upload")
@Api(tags = "通用分类上传文件")
@Slf4j
public class UnloadController {
    @Autowired
    private UnloadService unloadService;

    @PostMapping
    public Result<String> unload(@RequestBody MultipartFile file) throws IOException {
        log.info("上传文件接口，文件为：{}",file);

        Result<String> result = unloadService.unload(file);

        return result;
    }

}
